﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Security.Permissions;
using System.ComponentModel;
using System.Web.UI;

namespace JQuery.Net.UI
{
    [AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal)]
    [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
    [DefaultProperty("Columns"), DefaultEvent("ClientCallback")]
    [ToolboxData("<{0}:Grid runat=server></{0}:Grid>")]
    public class Grid
        : jQNetControl
        , INamingContainer
        , IjQNetCallbackHandler
    {
        #region "fields"
        private readonly static object callback_key = new object();
        #endregion

        #region constructor
        public Grid()
            : base(HtmlTextWriterTag.Div)
        {
        }
        #endregion

        public override void RegisterJQNScriptStartup(System.IO.StringWriter writer)
        {
            throw new NotImplementedException();
        }

        public event jQNetHandler ClientCallback
        {
            add { Events.AddHandler(callback_key, value); }
            remove { Events.RemoveHandler(callback_key, value); }
        }
    }
}
